#Boa:Dialog:Dialog1

import wx
import ruleManager

def create(parent):
    return Dialog1(parent)

[wxID_DIALOG1, wxID_DIALOG1BUTTON1, wxID_DIALOG1MONTHTXT, 
 wxID_DIALOG1STATICTEXT1, wxID_DIALOG1STATICTEXT2, wxID_DIALOG1YEARTXT, 
] = [wx.NewId() for _init_ctrls in range(6)]

class Dialog1(wx.Dialog):
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DIALOG1, name='', parent=prnt,
              pos=wx.Point(396, 150), size=wx.Size(259, 208),
              style=wx.DEFAULT_DIALOG_STYLE, title='')
        self.SetClientSize(wx.Size(243, 170))

        self.staticText1 = wx.StaticText(id=wxID_DIALOG1STATICTEXT1,
              label='Anio:', name='staticText1', parent=self, pos=wx.Point(32,
              24), size=wx.Size(26, 13), style=0)

        self.staticText2 = wx.StaticText(id=wxID_DIALOG1STATICTEXT2,
              label='Mes:', name='staticText2', parent=self, pos=wx.Point(32,
              64), size=wx.Size(24, 13), style=0)

        self.yearTxt = wx.TextCtrl(id=wxID_DIALOG1YEARTXT, name='yearTxt',
              parent=self, pos=wx.Point(112, 24), size=wx.Size(100, 21),
              style=0, value='')

        self.monthTxt = wx.TextCtrl(id=wxID_DIALOG1MONTHTXT, name='monthTxt',
              parent=self, pos=wx.Point(112, 56), size=wx.Size(100, 21),
              style=0, value='')

        self.button1 = wx.Button(id=wxID_DIALOG1BUTTON1, label='Guardar',
              name='button1', parent=self, pos=wx.Point(24, 120),
              size=wx.Size(75, 23), style=0)
        self.button1.Bind(wx.EVT_BUTTON, self.OnSaveButton,
              id=wxID_DIALOG1BUTTON1)

    def __init__(self, parent, type):
        self._init_ctrls(parent)
        self.type = type

    def OnSaveButton(self, event):
        self.rule_spec = ruleManager.new_rule_spec(0, 0, [], 0, self.yearTxt.GetValue(), self.monthTxt.GetValue(), self.type)
        self.Close()
